package day06;

import java.util.Arrays;
import java.util.Scanner;

public class txt9 {
    public static void main(String[] args) {
        int[] a = new int[5];
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i <= 4; i++) {
            a[i] = sc.nextInt();

        }

        Arrays.sort(a);
        System.out.println(Arrays.toString(a));
        int sum = 0;
        for (int i = 1; i <= 3; i++) {
            sum = sum + a[i];
        }

        System.out.println(sum / (a.length - 2));

    }
}
